import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询列表
export function list (query) {
    return request({
        url: '/manage/turnoverBox/turnoverBoxPage',
        method: 'get',
        params: query
    })
}

// 详情
export function getById (query) {
    return request({
        url: '/manage/turnoverBox/getById/' + query.id,
        method: 'get',
        params: query
    })
}

// 新增
export function add (data) {
    return request({
        url: '/manage/turnoverBox/add',
        method: 'post',
        data: data
    })
}

// 修改
export function edit (data) {
    return request({
        url: '/manage/turnoverBox/edit',
        method: 'put',
        data: data
    })
}

// 删除
export function deleteById (data) {
    return request({
        url: '/manage/turnoverBox/deleteById/' + data.id,
        method: 'delete',
        data
    })
}

// 根据周转箱id获取周转箱设备列表
export function getDeviceListByBoxId (id) {
    return request({
        url: '/manage/turnoverBox/getDeviceListByBoxId/' + id,
        method: 'get',
    })
}

// 获取周转箱列表
export function getSchoolTurnoverBoxList () {
    return request({
        url: '/manage/turnoverBox/getTurnoverBoxList',
        method: 'get',
    })
}

// 根据设备id获取设备所在周转箱列表
export function getTurnoverBoxListByDeviceId (id) {
    return request({
        url: '/manage/turnoverBox/getTurnoverBoxListByDeviceId/' + id,
        method: 'get',
    })
}